#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
 
int main()
{
    string str = "";
    getline(cin, str);
    unordered_map<char, int> hash; // 字符和出现的次数
    for (auto& e : str)
    {
        hash[e]++;
    }
    string strOne = "";
    for (auto& e : hash)
    {
        if (e.second == 1)
        {
            strOne += e.first;
        }
    }
    // cout << strOne << endl;
    for (auto& e : str)
    {
        for (auto& One : strOne)
        {
            if (One == e)
            {
                cout << e << endl;
                return 0;
            }
        }
    }
    cout << -1 << endl;
    return 0;
}